package de.fhhannover.inform.hnefatafl.spiel;

import de.fhhannover.inform.hnefatafl.vorgaben.BoardContent;
import de.fhhannover.inform.hnefatafl.vorgaben.Cell;

public class Field implements Cell{
	
	int 			col;
	int 			row;
	boolean 		hasEnemyWest,
					hasEnemyEast,
					hasEnemyNorth,
					hasEnemySouth;
	BoardContent 	content;
	
	public Field(int col, int row){
		this.col = col;
		this.row = row;
	}
	
	public Field(int col, int row, BoardContent content){
		this.col 		= col;
		this.row 		= row;
		this.content	= content;
		hasEnemyWest 	= false;
		hasEnemyEast 	= false;
		hasEnemyNorth 	= false;
		hasEnemySouth 	= false;
	}

	@Override
	public int getCol() {
		return col;
	}

	@Override
	public int getRow() {
		return row;
	}

	@Override
	public BoardContent getContent() {
		return content;
	}
	
	void setContent(BoardContent content){
		this.content = content;
	}
	
	void setContentEmpty(){
		this.content = BoardContent.EMPTY;
	}
	
	@Override
	public String toString(){
		return String.format("["+col+", "+row+"]");
	}
	
	public boolean getWest(){
		return hasEnemyWest;
	}
	
	public void setWest(){
		this.hasEnemyWest = true;
	}
	
	public boolean getEast(){
		return hasEnemyEast;
	}
	
	public void setEast(){
		this.hasEnemyEast = true;
	}
	
	public boolean getNorth(){
		return hasEnemyNorth;
	}
	
	public void setNorth(){
		this.hasEnemyNorth = true;
	}
	
	public boolean getSouth(){
		return hasEnemyWest;
	}
	
	public void setSouth(){
		this.hasEnemyWest = true;
	}
	
	public void setDefault(){
		hasEnemyEast = false;
		hasEnemyWest = false;
		hasEnemySouth = false;
		hasEnemyNorth = false;
	}
	

}
